<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/



/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

Route::group(['middleware' => ['web','weixin'],'namespace'=>'Home'], function () {
    Route::any('/', 'IndexController@index')->middleware('auths');
    Route::any('/pushGoods', 'GoodsController@pushGoods');
    Route::any('/test', 'IndexController@test');
    Route::any('/menu', 'WechatController@menu_add');

    Route::any('/ewmtest', 'WechatController@ewm');

    // 产品溯源
    Route::get('suyuan/{id}', 'IndexController@suyuan');
    // 积分商城
    Route::get('/integral', 'IndexController@integral')->middleware('auths');
    Route::get('/integral-detail/{id}', 'IndexController@detail')->middleware('auths');
    Route::get('/integral-pay', 'IndexController@pay');
    // 兑换记录
    Route::get('/integral-orders', 'UserController@integralOrders');
    // 积分兑换确认收货
    Route::get('/goods-integral-receipt', 'UserController@goodsIntegralReceipt');
    // 兑换订单物流查询
    Route::get('/integral-orders-logistic/{id}', 'UserController@integralOrdersLogistic');
    // ajax请求获取积分商品
    Route::get('/get-goods-integral-list', 'IndexController@getGoodsIntegralList');
    // 商品列表
    Route::get('/lists', 'GoodsController@lists');
    // 商品分类列表
    Route::get('/lists/{id}', 'GoodsController@listsMenu');
    //热销商品
    Route::get('/hotGoods', 'GoodsController@hotGoods');
    // ajax请求获取分类商品
    Route::get('/get-goods-menu-list', 'GoodsController@getGoodsMenuList');
    // 商品详情
    Route::get('/detail/{clothing_id}', 'GoodsController@detail')->middleware('auths');
    // ajax请求获取商品
    Route::get('/get-goods-list', 'GoodsController@getGoodsList');
    // 分类
    Route::get('/assort', 'GoodsController@assort');
    // 购物车
    Route::get('/cart', 'CartController@cart');
    // 个人中心
    Route::any('/my', 'UserController@my')->middleware('auths');
    //签到
    Route::get('/addSign', 'UserController@addSign');
    // 订单中心
    Route::get('/orders', 'OrdersController@orders')->middleware('auths');
    Route::get('/deleteOrders', 'OrdersController@deleteOrders');
    // 收藏中心
    Route::get('/collection', 'UserController@collection');
    // 地址管理
    Route::get('/address', 'UserController@address');
    // 地址添加
    Route::get('/add-address', 'UserController@addAddress');
    Route::get('/delete-address', 'UserController@delAddress');
    Route::get('/update-address/{id}', 'UserController@upAddress');
    Route::post('/update-address-res', 'UserController@upAddressRes');
    // ajax请求保存购物信息
    Route::get('/save-confirm', 'CartController@saveConfirm');
    // ajax请求保存购物车信息
    Route::get('/save-cart', 'CartController@saveCart');
    // 提交订单
    Route::get('/confirm/{id}/{type}', 'CartController@confirm');
    // 选择收货地址
    Route::get('/address', 'UserController@address');
    // 选择收货地址
    Route::post('/save-address', 'UserController@saveAddress');
    // 支付订单
    Route::any('/pay/{type}/{id}', 'CartController@pay');
    // ajax删除购物车商品
    Route::get('/delete', 'CartController@delete');
    // ajax批量删除购物车商品
    Route::get('/delete-all', 'CartController@deleteAll');
    // 返点记录
    Route::get('/record', 'UserController@record');
    // 我的团队
    Route::get('/team', 'UserController@team');
    //帮助中心
    Route::get('/help', 'UserController@helpList');
    Route::get('/helpDetail/{id}', 'UserController@helpDetail');

    Route::any('/auth', 'IndexController@auth');

    // 评论
    Route::get('/comment/{goods_id}/{orders_info}', 'CommentController@comment');
    // 评论提交
    Route::post('/comment-res', 'CommentController@commentRes');
    // 评论图片异步上传
    Route::post('/comment-upload-image', 'CommentController@commentUploadImage');
    // 评论图片异步删除
    Route::get('/delete-img', 'CommentController@deleteImg');
    // 确认收货
    Route::get('/goods-receipt', 'OrdersController@goodsReceipt');

    // 查看物流
    Route::get('/logistic/{id}', 'OrdersController@logistic');

    // 申请退款
    Route::any('/refund/{id}', 'CommentController@refund');
    // 申请退款提交
    Route::post('/refund-res', 'CommentController@refundRes');
    // 申请退款失败
    Route::get('/refund-fail/{id}', 'CommentController@refundFail');
    // 退款图片异步上传
    Route::post('/refund-upload-image', 'CommentController@refundUploadImage');

    //微信支付
    Route::any('/pays', 'CartController@pays');
    Route::any('/paySuccess', 'CartController@paySuccess');
    //企业支付
    Route::any('/business', 'WechatController@business');
    //模板消息
    Route::any('/template', 'WechatController@template');
    //获取media_id
    Route::any('/getMediaId', 'WechatController@getMediaId');

    // 成为分销商
    Route::any('/distributor', 'UserController@distributor');
    Route::any('/save-distributor', 'UserController@saveDistributor');
    // 分销商身份证上传
    Route::post('/distributor-upload-image', 'UserController@distributorUploadImage');

    // 浏览记录
    Route::get('history', 'UserController@history');
    Route::get('tests', 'IndexController@tests');
    //提现申请
    Route::get('withdrawals', 'UserController@withdrawals');
    Route::get('withdrawals_history', 'UserController@withdrawalsHistory');
    Route::get('/store', 'IndexController@store');
    Route::get('/order_template', 'IndexController@orderTemplate');
});
Route::group(['middleware' => ['web'],'namespace'=>'Home'], function() {
    //微信端
    Route::any('/wechat', 'WechatController@serve');
    //公司介绍
    Route::get('/company', 'IndexController@company');
});
Route::group(['middleware' => ['web', 'login'],'namespace'=>'Admin'], function () {
    Route::get('/admin', 'IndexController@index');
    Route::get('/skin-config', 'IndexController@skinConfig');
    Route::get('/admin/goods-list', 'GoodsController@goodsList');
    Route::get('/admin/delete-image', 'GoodsController@deleteImage');
    Route::get('/admin/user-list', 'UserController@userList');
    Route::get('/admin/orders-list', 'OrdersController@ordersList');
    Route::get('/admin/orders-detail/{id}', 'OrdersController@ordersDetail');
    Route::get('/admin/address-list', 'AddressController@addressList');
    Route::get('/admin/menu-list', 'MenuController@menuList');
    Route::get('/admin/menu-add', 'MenuController@menuAdd');
    Route::get('/admin/menu-update/{id}', 'MenuController@menuUpdate');
    Route::post('/admin/menu-update-res', 'MenuController@menuUpdateRes');
    Route::get('/admin/menu-delete', 'MenuController@menuDelete');
    Route::get('/admin/get-menu-info', 'MenuController@getMenuInfo');
    Route::post('/admin/menu-add-res', 'MenuController@menuAddRes');
    Route::get('/admin/user-detail/{id}', 'UserController@userDetail');
    Route::get('/admin/changeStatus', 'GoodsController@changeStatus');
    //设置热销商品
    Route::get('/admin/changeGoodsType', 'GoodsController@changeGoodsType');
    Route::get('/admin/changeClothingStatus', 'GoodsController@changeClothingStatus');
    Route::get('/admin/goods-detail/{id}', 'GoodsController@goodsDetail');
    Route::get('/admin/goods-update/{id}', 'GoodsController@goodsUpdate');
    Route::get('/admin/goods-add', 'GoodsController@goodsAdd');
    Route::post('/admin/goods-add-res', 'GoodsController@goodsAddRes');
    Route::post('/admin/goods-update-res', 'GoodsController@goodsUpdateRes');
    Route::get('/admin/delete', 'GoodsController@delete');
    Route::get('/admin/delete-clothing-attr', 'GoodsController@deleteClothingAttr');
    Route::get('/admin/special-price', 'GoodsController@specialPrice');
    Route::get('/admin/update-special-price-status', 'GoodsController@updateSpecialPriceStatus');
    Route::get('/admin/update-special-price', 'GoodsController@updateSpecialPrice');
    Route::get('/admin/exchange', 'GoodsController@exchange');
    Route::get('/admin/update-exchange-status', 'GoodsController@updateExchangeStatus');
    Route::get('/admin/update-exchange', 'GoodsController@updateExchange');
    Route::get('/admin/vip', 'GoodsController@vip');
    Route::get('/admin/update-vip-status', 'GoodsController@updateVipStatus');
    Route::get('/admin/update-vip', 'GoodsController@updateVip');
    Route::get('/admin/comment-list', 'CommentController@commentList');
    Route::get('/admin/comment-reply', 'CommentController@replyComment');
    Route::get('/admin/recycle-bin', 'RecycleController@recycleBin');
    Route::get('/admin/reply', 'RecycleController@reply');
    Route::get('/admin/spec-list', 'ClothingController@specList');
    Route::get('/admin/spec-add', 'ClothingController@specAdd');
    Route::post('/admin/spec-add-res', 'ClothingController@specAddRes');
    Route::get('/admin/spec-update/{id}', 'ClothingController@specUpdate');
    Route::post('/admin/spec-update-res', 'ClothingController@specUpdateRes');
    Route::get('/admin/spec-delete', 'ClothingController@specDelete');
    Route::get('/admin/delete-in-grain', 'RecycleController@deleteInGrain');
    Route::get('/admin/fenxiao-list', 'UserController@fenxiaoList');
    Route::get('/admin/vip-list', 'UserController@vipList');
    Route::get('/admin/fenxiao-set', 'UserController@fenxiaoSet');
    Route::get('/admin/quxiao', 'UserController@quxiao');
    Route::post('/admin/fenxiao-set-res', 'UserController@fenxiaoSetRes');
    Route::get('/admin/fenxiao-detail/{id}', 'UserController@fenxiaoDetail');
    // 分销商申请
    Route::get('/admin/fenxiao-apply', 'UserController@fenxiaoApply');
    // 分销商申请详情
    Route::get('/admin/fenxiao-apply-detail/{id}', 'UserController@fenxiaoApplyDetail');
    // 分销商通过
    Route::get('/admin/apply', 'UserController@apply');
    // 分销商驳回
    Route::get('/admin/apply-fail', 'UserController@applyFail');
    // 分销商通过
    Route::get('/admin/apply-form/{id}', 'UserController@applyForm');
    // 分销商驳回
    Route::post('/admin/apply-fail-form', 'UserController@applyFailForm');
    // 分销
    Route::get('/admin/fenxiao-reback', 'IndexController@reback');
    Route::get('/admin/fenxiao-pid/{id}/{type}', 'IndexController@pid');
    Route::get('/admin/fenxiao-arr/{arr}', 'IndexController@sum');

    // 发货列表
    Route::get('/admin/send-list', 'OrdersController@sendList');
    // 发货
    Route::get('/admin/send', 'OrdersController@send');
    // 快递查询
    Route::get('/admin/orders-logistic/{id}', 'OrdersController@logistic');
    // 退款列表
    Route::get('/admin/refund-list', 'OrdersController@refundList');
    // 退款
    Route::get('/admin/refund', 'OrdersController@refund');
    // 驳回
    Route::get('/admin/refund_fail', 'OrdersController@refundFail');
    //模板消息推送商品
    Route::get('/pushGoods','GoodsController@pushGoods');
    // 轮播图列表
    Route::get('/admin/banner-list', 'BannerController@bannerList');
    // 轮播图新增
    Route::get('/admin/banner-add', 'BannerController@bannerAdd');
    // 轮播图新增处理
    Route::post('/admin/banner-add-res', 'BannerController@bannerAddRes');
    // 轮播图修改
    Route::get('/admin/banner-update/{id}', 'BannerController@bannerUpdate');
    // 轮播图修改处理
    Route::post('/admin/banner-update-res', 'BannerController@bannerUpdateRes');
    // 轮播图删除
    Route::get('/admin/banner-delete', 'BannerController@bannerDelete');
    // 轮播图排序
    Route::get('/admin/sort', 'BannerController@bannerSort');
    //视频开关设置
    Route::get('/admin/video', 'BannerController@videoSet');
    Route::get('/admin/video/status', 'BannerController@videoSetStatus');
    // 积分设置
    Route::get('/admin/integral-set', 'GoodsController@integralSet');
    // 积分设置处理
    Route::post('/admin/integral-set-res', 'GoodsController@integralSetRes');
    // 兑换列表
    Route::get('/admin/integral-exchange-list', 'GoodsController@integralExchangeList');
    // 兑换详情
    Route::get('/admin/orders-integral-detail/{id}', 'GoodsController@ordersIntegralDetail');
    // 兑换发货
    Route::get('/admin/integral-exchange-send', 'GoodsController@integralExchangesend');
    // 兑换发货处理
    Route::get('/admin/integral-send', 'GoodsController@integralSend');
    // 兑换订单物流查询
    Route::get('/admin/integral-orders-logistic/{id}', 'GoodsController@integralOrdersLogistic');
    //帮助中心
    Route::get('/admin/help', 'UserController@help');
    Route::get('/admin/helpAdd', 'UserController@helpAdd');
    Route::get('/admin/helpUpdate/{id}', 'UserController@helpUpdate');
    Route::post('/admin/help-update-res', 'UserController@helpUpdateRes');
    Route::post('/admin/help-add-res', 'UserController@helpAddRes');
    Route::get('/admin/help-delete', 'UserController@helpDelete');
    //管理员登录
    Route::get('/admin/updatePwd','UserController@updatePwd');
    Route::get('/admin/updatePwdRes','UserController@updatePwdRes');
    //设置客服
    Route::get('/admin/changeIdentity','UserController@changeIdentity');
    // 报表
    Route::any('/admin/performance-report','ReportController@performanceReport');
    Route::any('/admin/exportPerformanceExcel/{start}/{end}/{type}','ReportController@exportPerformanceExcel');
    Route::any('/admin/exportUserExcel/{start}/{end}/{type}','ReportController@exportUserExcel');
    Route::any('/admin/exportSaleExcel/{start}/{end}/{type}','ReportController@exportSaleExcel');
    Route::any('/admin/user-report','ReportController@userReport');
    Route::any('/admin/sale-report','ReportController@saleReport');
    //提现管理
    Route::get('/admin/withdrawals-list','UserController@withdrawalsList');
    Route::get('/admin/withdrawals-apply','UserController@withdrawalsApply');
    Route::get('/admin/withdrawals-success','UserController@withdrawalsSuccess');
    Route::get('/admin/withdrawals-error','UserController@withdrawalsError');
    Route::get('/admin/withdrawals-yes','UserController@withdrawalsYes');
    Route::get('/admin/withdrawals-no','UserController@withdrawalsNo');
    Route::get('/admin/withdrawals-set','UserController@withdrawalsSet');
    Route::post('/admin/withdrawals-set-res','UserController@withdrawalsSetRes');
    //关于公司
    Route::get('/admin/company','IndexController@company');
    Route::post('/admin/editCompany','IndexController@editCompany');
    //线下门店
    Route::get('/admin/store','IndexController@store');
    Route::post('/admin/editStore','IndexController@editStore');
    // 访客记录
    Route::get('/admin/voist-list','HistoryController@voist');

});
Route::group(['middleware' => ['web'],'namespace'=>'Admin'], function () {
    Route::get('/admin/login','UserController@login');
    Route::get('/admin/loginRes','UserController@loginRes');
});